<!DOCTYPE html>
<html class="no-js " lang="zh-CN">
	<head>
		<meta charset="utf-8">
		<meta name="HandheldFriendly" content="True">
		<meta name="MobileOptimized" content="320">
		<meta name="format-detection" content="telephone=no">
		<meta http-equiv="cleartype" content="on">
		<!-- dns prefetch -->
		<link href="{$Think.config.RESOURCEURL}wx_assets/css/webpage.css?v=2013-12-17" rel="stylesheet" type="text/css">
		<link rel="stylesheet" type="text/css" href="{$Think.config.RESOURCEURL}wx_assets/css/page.css?v=2013-11-21">
		<link href="{$Think.config.RESOURCEURL}wx_assets/css/website_tagtpl/jd1.css" rel="stylesheet" type="text/css">
		<link href="{$Think.config.RESOURCEURL}wx_assets/css/website_tagtpl/jd2.css" rel="stylesheet" type="text/css">
		<script>
				function dourl(url){
					location.href= url;
				}

				var hrefParamsArray = GetParamsFromHref(window.location.search);
				 
				function GetParamsFromHref(search){
					var args = search.substring(1); 
				　　	var retval = new Array(); 
					args = args.split("&"); 
						for(var i = 0; i < args.length; i ++){ 
							str = args[i]; 
							var arg = str.split("="); 
							if(arg.length <= 1) {
								continue; 
							}
							if(arg[0] == 'params') {
								var params = decodeURIComponent(arg[1]);
								var obj = eval('(' + params + ')');
								retval["start"] = obj.start;	
								if (obj.tagname != undefined) {
									retval["tagname"] = obj.tagname;
								} else if (obj.id != undefined && obj.tplid != undefined) {
									retval["tagid"] = obj.id;
									retval["tplid"] = obj.tplid;
								}
							} else if(arg[0] == 'customerId') {
								retval["customerId"] = arg[1]; 
							}else if(arg[0] == 'userName'){
								retval["userName"] = arg[1]; 
							}
						} 
						
						if (retval["start"] == undefined) {
							retval["start"] = 0;
						}
						return retval; 
				}
				var limit = 10;
				var pageCount = Math.ceil({$total} / limit);
				var page = Math.ceil(hrefParamsArray["start"] / limit) + 1;

				function report(link, fakeid, action_type){
					var parse_link = parseUrl(link);
					if(parse_link == null)
					{
					  return ;
					}
					var query_obj = parseParams( parse_link['query_str'] );
					query_obj['action_type'] = action_type;
					query_obj['uin'] = fakeid;
					var report_url = '/mp/appmsg/show?' + jQuery.param( query_obj );
					jQuery.ajax({
					  url: report_url,
					  type: 'POST',
					  timeout: 2000
					})
				 };
				 
				function share_scene(link, scene_type) {
					// Android无法会截取encode的参数，所以改用直接添加参数的方式
					var share_url = link + '&scene=' + scene_type;
					return share_url;
				};

				(function() {
					var onBridgeReady = function() {
						var desString = "点击这里进入我们的微网站";
						var search = '?' + resetHerf(window.location.search);
						var link = window.location.protocol + "//"
									+ window.location.host + window.location.pathname + search;

						link = link.replace("{", "%7B");
						link = link.replace("}", "%7D");
						var appId = '', title = htmlDecode(hrefParamsArray["tagname"]), desc = htmlDecode(desString),
						imgUrl = '{$results[0].picurl}', fakeid = "Mjc2OTgzMTM1", desc = desc || link;

						// 发送给好友; 
						WeixinJSBridge.on('menu:share:appmessage', function(argv) {

							WeixinJSBridge.invoke('sendAppMessage', {
								"appid" : appId,
								"img_url" : imgUrl,
								"img_width" : "640",
								"img_height" : "640",
								"link" : share_scene(link, 1),
								"desc" : desc,
								"title" : title
							}, function(res) {
								report(link, fakeid, 1);
							});
						});
						// 分享到朋友圈;
						WeixinJSBridge.on('menu:share:timeline', function(argv) {
							report(link, fakeid, 2);
							WeixinJSBridge.invoke('shareTimeline', {
								"img_url" : imgUrl,
								"img_width" : "640",
								"img_height" : "640",
								"link" : share_scene(link, 2),
								"desc" : desc,
								"title" : title
							}, function(res) {
							});

						});

						// 分享到微博;
						var weiboContent = '';
						WeixinJSBridge.on('menu:share:weibo', function(argv) {

							WeixinJSBridge.invoke('shareWeibo', {
								"content" : title + share_scene(link, 3),
								"url" : share_scene(link, 3)
							}, function(res) {
								report(link, fakeid, 3);
							});
						});
						// 隐藏右上角的选项菜单入口;
						//WeixinJSBridge.call('hideOptionMenu');
					};
					if (document.addEventListener) {
						document.addEventListener('WeixinJSBridgeReady', onBridgeReady,
								false);
					} else if (document.attachEvent) {
						document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
						document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
					}
				})();

				function resetHerf(search){
				　　	var args = search.substring(1); 
				　　	var retval = new Array(); 
					args = args.split("&"); 
					for(var i = 0; i < args.length; i ++){ 
						str = args[i]; 
						var arg = str.split("="); 
						if(arg.length <= 1) continue; 
						if(arg[0] == 'userName'){
							args[i] = "userName=";
							break;
						}
					} 
					return args.join("&");
				}
				</script>
		<title>
			{$title}
		</title>
	</head>
		<body class=" ">
			<!-- container -->
			<div class="container shop-domain">
				<div class="header">
					 
				</div>
				<div class="content js-mini-height">
					<div class="content-body">
						 <div class="custom-title">
							<h2 class="title">{$results[0].tagName}</h2>
						</div>
						<div class="custom-richtext">
								<p><img src="{$results[0].picUrl}"></p>
						</div>

						 <volist name="results" id ="res">					
						<div class="custom-messages single">
						<script>						
							var hrefParamsArray = GetParamsFromHref(window.location.search);
							var baseUrl = '{$Think.config.SERVER_HOST}';
							var pageId = '{$res.id}';
							var tplId = '{$res.tplid}';
							var urlString = baseUrl + "call.html?customerId="+ hrefParamsArray["customerId"]+ "&userName=" +
									hrefParamsArray["userName"] +
									"&module=webPage&method=getWebPage&params=%7B%22id%22:"+pageId+",%22tplid%22:"+tplId+"%7D";
							document.write("<a href='"+urlString+"' class='clearfix'>");				
							</script>
							<h4 class="title">
								{$res.title} 
							</h4>
							<notempty name="res.picurl">
								<div class="image">
									<img class="js-lazy"   src={$res.picurl} />
								</div>							
							</notempty>
							<notempty name="res.content">
								<div class="summary" >
									{$result.description}
								</div>
							</notempty>
							</a>
						</div>
					</volist>
						<!-- 分页 -->
						<div class="pagination"  id="pagination" >
			<div id="pagePrev">
			<script>if (page != 1) {
				var baseUrl = '{$Think.config.SERVER_HOST}';
				var start = parseInt(hrefParamsArray["start"]) - limit;
				var params = '';
				if (hrefParamsArray["tagname"] != undefined) {
					params = '\"tagname\":\"' + hrefParamsArray["tagname"] + '\"';
				} else if (hrefParamsArray["tagid"] != undefined && hrefParamsArray["tpld"] != undefined) {
					params = '\"id\":' + hrefParamsArray["tagid"]+'\"tplid\":' + hrefParamsArray["tplid"];
				}
				var urlString = baseUrl + 'call.html?customerId='+ hrefParamsArray["customerId"]+'&userName='+hrefParamsArray["userName"]
				+ '&module=webSite&method=getWebSiteTag&params=%7B"id":'+hrefParamsArray["tagid"]+',"tplid":'
				+ hrefParamsArray["tplid"] +',"start":'+start+'%7D';
				
				document.write("<a href='" + urlString + "'>上一页</a>");
			} else {
				document.write("<a href='javascript:void(0)' style='background:none;border:1px solid #cbcbcb;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;color:A4A3A3;cursor: default;'>上一页</a>");
			}
			</script>
			</div>
			<div class="allpage">
				<div class="currentpage"><script>document.write(page + "/" + pageCount);</script></div>
			</div>
			<div id="pageNext">
			<script>if (page != pageCount) {
				var baseUrl = '{$Think.config.SERVER_HOST}';
				var start = parseInt(hrefParamsArray["start"]) + limit;
				var params = '';
				if (hrefParamsArray["tagname"] != undefined) {
					params = '\"tagname\":\"' + hrefParamsArray["tagname"] + '\"';
				} else if (hrefParamsArray["tagid"] != undefined) {
					params = '\"id\":' + hrefParamsArray["tagid"];
				}
				var urlString = baseUrl + 'call.html?customerId='+ hrefParamsArray["customerId"]+'&userName='+hrefParamsArray["userName"]
				+ '&module=webSite&method=getWebSiteTag&params=%7B"id":'+hrefParamsArray["tagid"]+',"tplid":'
				+ hrefParamsArray["tplid"] +',"start":'+start+'%7D';
				document.write("<a href='" + urlString + "'>下一页</a>");
			} else {
				document.write("<a href='javascript:void(0)' style='background:none;border:1px solid #cbcbcb;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;color:A4A3A3;cursor: default;'>下一页</a>");
			}
			</script>
			</div>
		</div> 
					</div>										 
				</div>
				 
				<!-- fuck taobao -->
				<div id="js-fuck-taobao" class="fullscreen-guide fuck-taobao hide">
					<span class="js-close-taobao guide-close">
						&times;
					</span>
					<span class="guide-arrow">
					</span>
					<div class="guide-inner">
						<div class="step step-1">
						</div>
						<div class="js-step-2 step">
						</div>
					</div>
				</div>
			</div>
			<script>
				window.refreshCartIcon = function() { !! $ && $.ajax({
						url: window._global.url.wap + '/trade/cart/count.jsonp',
						type: 'GET',
						timeout: 5000,
						dataType: "jsonp",
						success: function(resp) {
							if (parseInt(resp.code) === 0) {
								var count = parseInt(resp.data);
								if (count > 0) {
									$('#global-cart').removeClass('hide');
								} else {
									$('#global-cart').addClass('hide');
								}
							}
						}
					});
				};
				refreshCartIcon();
			</script>
	 
		</body>

</html>